﻿using CNKI.TPI.Web.Admin.Model;
using CNKI.TPI.Web.Search.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace CNKI.TPI.Web.Admin.IBLL
{
    /// <summary>
    /// 
    /// </summary>
    public interface ISubjectHomeService
    {
        /// <summary>
        /// 根据专题名称查询专题
        /// </summary>
        /// <param name="name"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC> GetTopicByNamePageSize(string name, int start, int length, out int count);

        /// <summary>
        /// 保存专题
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool SaveTopic(SYS_CMS_TOPIC obj);

        /// <summary>
        /// 删除专题
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteSubject(string sysidstr);

        /// <summary>
        /// 根据导航名称查询
        /// </summary>
        /// <param name="name"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS> GetNavByNamePageSize(string name, int start, int length, out int count);
        /// <summary>
        /// 保存导航
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool SaveNav(SYS_CMS_TOPIC_CLS obj);

        bool SaveDB(SYS_CMS_TOPIC_DBCONFIG obj);
        /// <summary>
        /// 删除导航
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteNav(string sysidstr);

        bool DeleteDB(string sysidstr);
        /// <summary>
        /// 判断导航名称是否重复
        /// </summary>
        /// <param name="name"></param>
        /// <param name="sysid"></param>
        /// <returns></returns>
        bool IsExistNav(string name, int sysid);

        /// <summary>
        /// 判断数据源名称是否重复
        /// </summary>
        /// <param name="name"></param>
        /// <param name="sysid"></param>
        /// <returns></returns>
        bool IsExistDB(string name, int sysid);

        /// <summary>
        /// 判断导航分类是否重复
        /// </summary>
        /// <param name="name"></param>
        /// <param name="sysid"></param>
        /// <returns></returns>
        bool IsExistSubject(string name, int sysid);

        /// <summary>
        /// 根据数据源名称查询
        /// </summary>
        /// <param name="name"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_DBCONFIG> GetDBByNamePageSize(string name, int start, int length, out int count);
        IList<SYS_CMS_TOPIC_DBCONFIG> GetDBBySysId(string sysid);
        /// <summary>
        /// 保存分类
        /// </summary>
        /// <param name="clscode"></param>
        /// <param name="sysid"></param>
        /// <param name="nodename"></param>
        /// <param name="parentcode"></param>
        /// <param name="grade"></param>
        /// <returns></returns>
        bool SaveNavCate(string clscode, int sysid, string nodename, string parentcode, int grade);

        /// <summary>
        /// 根据导航编码获取分类信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_NODE> GetCateByNavCode(string code);

        /// <summary>
        /// 获取子节点
        /// </summary>
        /// <param name="clscode"></param>
        /// <param name="grade"></param>
        /// <param name="syscode"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_NODE> GetCateChilds(string clscode, int grade, string syscode);

        /// <summary>
        /// 删除分类节点
        /// </summary>
        /// <param name="sysidstr"></param>
        ///     /// <param name="clscode"></param>
        /// <returns></returns>
        bool DeleteCLsNode(string sysidstr, string clscode);

        /// <summary>
        /// 保存检索条件
        /// </summary>
        /// <param name="order"></param>
        /// <param name="querlist"></param>
        /// <param name="dbcode"></param>
        /// <param name="dbname"></param>
        /// <param name="nodecode"></param>
        /// <param name="clsCode"></param>
        /// <returns></returns>
        bool SaveQuery(string order, IList<SearchQuery> querlist, string dbcode, string dbname, string nodecode, string clsCode);

        /// <summary>
        /// 根据数据库和分类code称查询专题
        /// </summary>
        /// <param name="dbname"></param>
        /// <param name="nodecode"></param>
        /// <param name="navCode"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_QUERY> GetQueryPageSize(string dbname, string nodecode, string navCode, int start, int length, out int count);

        /// <summary>
        /// 删除分类条件
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteCLsQuery(string sysidstr);

        /// <summary>
        /// 根据查询条件获取SYS_CMS_TOPIC_PAGECONFIG数据
        /// </summary>
        /// <param name="columname"></param>
        /// <param name="topiccode"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_PAGECONFIG> GetPageConfigPageSize(string columname, string topiccode, int start, int length, out int count);

        /// <summary>
        /// 获取所有分类数据
        /// </summary>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS> GetNavAll();

        /// <summary>
        /// 获取所有数据源数据
        /// </summary>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_DBCONFIG> GetDBAll();

        /// <summary>
        /// 根据分类编码查询数据
        /// </summary>
        /// <param name="nodecode"></param>
        /// <param name="clscode"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_QUERY> GetQueryByNodeCode(string nodecode, string clscode);

        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool SavePageConfig(SYS_CMS_TOPIC_PAGECONFIG obj);

        /// <summary>
        /// 根据ID查询配置信息
        /// </summary>
        /// <param name="sysid"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_PAGECONFIG> GetPageConfigByID(string sysid);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeletePageConfig(string sysidstr);

        /// <summary>
        /// 修改显示顺序
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        bool UpdatePageSort(IList<SYS_CMS_TOPIC_PAGECONFIG> list);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="clscode"></param>
        /// <param name="nodecode"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_NODE> GetByCLSNodeCode(string clscode, string nodecode);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_PAGECONFIG> GetPageConfigAll();

    }
}
